<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


<c:choose>
	<c:when test="${not empty convenio.id}">
		<form id="defaultForm" class="form" action="${pageContext.request.contextPath}/convenios/update" method="POST">
	</c:when>
	<c:otherwise>
		<form id="defaultForm" class="form" action="${pageContext.request.contextPath}/convenios/save" method="POST">
	</c:otherwise>
</c:choose>

	<div class="span9">
		<div class="well well-large">
		
			<c:if test="${not empty errors}">
				<c:forEach items="${errors}" var="error">
					<div class="alert alert-error">
						<button name="skipAjax" type="button" class="close" data-dismiss="alert">&times;</button>
						${error.message}
					</div>
				</c:forEach>
			</c:if>
		
			<ul class="thumbnails">
			  	<li class="span4">
			  		<i class="icon-list-alt"></i> <fmt:message key="BUNDLE_CONVENIO"/>
			  	
			    	<div class="thumbnail">
			    	
			    		<input type="hidden" name="convenio.id" value="${convenio.id}"/>
			    	
			    		<div class="field">
							<fmt:message key="BUNDLE_NOME"/><br />
							
							<input type="text" name="convenio.nome" value="${convenio.nome}" required/>
						</div>
			    	
						<div class="field">
							<fmt:message key="BUNDLE_NUMERO"/><br />
							
							<input type="text" name="convenio.numero" value="${convenio.numero}" required/>
						</div>
						
					</div>
				</li>
			</ul>
		</div>
	</div>
	
	<div class="span3">
		<div class="actions">
			<button name="submit" type="submit" class="btn btn-success">
				<i class="icon-ok icon-white"></i> <fmt:message key="BUNDLE_CONFIRM"/>
			</button>
			
			<a class="btn btn-warning" href="${pageContext.request.contextPath}/convenios">
				<i class="icon-share-alt icon-white"></i> <fmt:message key="BUNDLE_BACK"/>
			</a>
		</div>
	</div>
</form>